# 设置CMake的最小版本
cmake_minimum_required(VERSION 3.15)

# 项目名称
#   项目可以包含多个目标(target)
#   target: 可执行程序, 静态库, 动态库
project(SearchEngine)

# 指定C++的版本: -std=c++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置可执行程序生成的路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../)

# 生成的可执行程序
add_executable(SearchEngineServer
    Acceptor.cpp  
    InetAddress.cpp     
    SearchEngineServer.cpp  
    SocketIO.cpp   
    TcpConnection.cpp
    EventLoop.cpp   
    ProtocolParser.cpp  
    Socket.cpp              
    TaskQueue.cpp  
    TcpServer.cpp      
    ThreadPool.cpp
    MyTask.cpp
    MyThread.cpp
    Test.cpp
)

target_link_libraries(SearchEngineServer PRIVATE 
    
)

# 设置编译选项
target_compile_options(SearchEngineServer PRIVATE
    -fno-rtti
    -g
    -Wall
    -DDEBUG
)

add_executable(client
    client.cpp
    ProtocolParser.cpp
    MyTask.cpp
    Acceptor.cpp  
    InetAddress.cpp     
    SearchEngineServer.cpp  
    SocketIO.cpp   
    TcpConnection.cpp
    EventLoop.cpp   
    Socket.cpp              
    TaskQueue.cpp  
    TcpServer.cpp      
    MyThread.cpp
    ThreadPool.cpp
)

# 设置编译选项
target_compile_options(client PRIVATE
    -fno-rtti
    -g
    -Wall
    -DDEBUG
)

target_link_libraries(client PRIVATE 

)